#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project ：auto-test 
@File    ：LeftMenuBase.py
@Author  ：赵加响
@Date    ：2022/12/16 17:21 
@Desc    ：
"""
from selenium.webdriver.common.by import By

from base.ObjectMap import ObjectMap


class LeftMenuBase(ObjectMap):

    def level_one_menu(self, menu_name):
        """
        一级菜单栏
        :param menu_name: 菜单栏名称
        :return:
        """
        return "//aside[@class='el-aside']//span[text()='" + menu_name + "']/ancestor::li"

    def level_two_menu(self, menu_name):
        """
        二级菜单栏
        :param menu_name: 菜单栏名称
        :return:
        """
        return "//aside[@class='el-aside']//span[text()='" + menu_name + "']/parent::li"
